/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package EvoAlg;

import java.util.Random;

/**
 *
 * @author Geost1gma
 */
public class Phenotype {
    private Genotype[] genes;
    private int numberOfGenes = 5;

    public static int VALUE_A = 0;
    public static int VALUE_B = 1;
    public static int VALUE_C = 2;
    public static int VALUE_D = 3;
    public static int VALUE_K = 4;

    Phenotype() {
        genes = new Genotype[5];
        Random r = new Random();
        Math.random();
        genes[0] = new Genotype(returnRandom(Algorithm.MIN_A, Algorithm.MAX_A));
        genes[1] = new Genotype(returnRandom(Algorithm.MIN_B, Algorithm.MAX_B));
        genes[2] = new Genotype(returnRandom(Algorithm.MIN_C, Algorithm.MAX_C));
        genes[3] = new Genotype(returnRandom(Algorithm.MIN_D, Algorithm.MAX_D));
        genes[4] = new Genotype(returnRandom(Algorithm.MIN_K, Algorithm.MAX_K));
        this.numberOfGenes = 5;
    }

    public Genotype[] getGenes() {
        return genes;
    }

    public void setGenes(Genotype[] genes) {
        this.genes = genes;
    }

    public int getNumberOfGenes() {
        return numberOfGenes;
    }

    public void setNumberOfGenes(int numberOfGenes) {
        this.numberOfGenes = numberOfGenes;
    }
    public Genotype getGeneAtIndex(int index){
        return genes[index];
    }
    public void setGeneAtIndex(Genotype in, int index){
        genes[index] = in;
    }
    
    public double returnRandom(double min, double max){
        return Math.random()*(max-min) + min;
    }

}
